//编辑回显数据
function update() {
    $.ajax({
        type: "post",
        "url": getRootPath()+"/anno/findById" ,
        "data": "",
        "async": false,
        "dataType": "json",
        "success": function (result) {
            if (result.code == 200) {
                $("#title").val(result.data.title);
                $("#content").val(result.data.content);

            } else {
                error.innerHTML = json.msg;
            }
        }
    });
}
//更新公告
function updateById(form) {
    $.ajax({
        type: "post",
        "url": getRootPath()+"/anno/updateById",
        "data": "title=" + $(form.title).val() + "&content=" + $(form.content).val() ,
        "async": false,
        "dataType": "json",
        "success": function (result) {
            if (result.code == 200) {
                setTimeout(function () {
                    window.location.reload();
                }, 2000);
            } else {
                error.innerHTML = json.msg;
            }
        }
    });
    return false;
}